import Vue from 'vue'
import VueRouter from 'vue-router'
// const Home = () => import(/* webpackChunkName: "Home" */ '../pages/Home/Home.vue')

Vue.use(VueRouter)


const router = new VueRouter({
  routes:[
		// 重定向地址
		{
			path: '/',
			redirect: '/login'
		},
		{
			path: '/home',
			component: () => import(/* webpackChunkName: "home" */ '../pages/Home/Home.vue'),
			meta:{
				showFooter: true
			}
		},
		{
			path: '/order',
			component: () => import(/* webpackChunkName: "order" */ '../pages/Order/Order.vue'),
			meta:{
				showFooter: true
			}
		},
		{
			path: '/profile',
			component: () => import(/* webpackChunkName: "profile" */ '../pages/Profile/Profile.vue'),
			meta:{
				showFooter: true
			}
		},
		{
			path: '/search',
			component: () => import(/* webpackChunkName: "search" */ '../pages/Search/Search.vue'),
			meta:{
				showFooter: true
			}
		},
		{
			path: '/login',
			component: () => import(/* webpackChunkName: "login" */ '../pages/Login/Login.vue')
		},
		{
			path: '/shops',
			component: () => import(/* webpackChunkName: "shops" */ '../pages/Shops/Shop.vue'),
			children: [
				{
					path: '/shops',
					redirect: "/shops/goods"
				},
				{
					path: '/shops/info',
					component: () => import(/* webpackChunkName: "shops" */ '../pages/Shops/Info.vue')
				},
				{
					path: '/shops/goods',
					component: () => import(/* webpackChunkName: "shops" */ '../pages/Shops/Goods.vue')
				},
				{
					path: '/shops/ratings',
					component: () => import(/* webpackChunkName: "shops" */ '../pages/Shops/Ratings.vue')
				}
			]
		}
	]
})

export default router
